package com.es.designmode.decorator;

/**
 * @author Will
 */
public class Decorator extends Component {

    protected Component component;

    public void setComponent(Component component) {
        this.component = component;
    }

    /**
     * 重写 Operation
     * 实际执行的还是 Component的 Operation
     */
    @Override
    public void operation() {
        if (component != null) {
            component.operation();
        }
    }
}
